<%@ page language="java" contentType="text/html;charset=utf-8" pageEncoding="utf-8"%>

<%@ include file="/core/taglibs.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">

<head>
<%@ include file="/core/memberMeta.jsp"%>
<script src="<%=basePath%>/resources/memberCss/assets/js/jquery-1.10.2.min.js"></script>
<script type="text/javascript"> 
		$(function() {
		    $('#submit').click(function() {
		    	var checkSubmitFlg = true; 
		    	if ($("#activeLoginName").val() != $("#loginName").val() ) {
					alert("要报单的代理商号不正确。");
					 
					checkSubmitFlg= false;
				}  
				if ($("#myTwoPassword").val() == "") {
					alert("请输入安全密码。");
					checkSubmitFlg= false;
				}
		    	if(checkSubmitFlg==true){
		    		
		    		var this_ = this;
			    	this_.setAttribute("disabled", true);  
			    	this_.value="请稍等，提交中...";  
			        $.ajax({
			            url: '<%=basePath%>/member/member/memberActiveKong.shtml',
			            type: 'post',
			            dataType:'json',
			            data: $("#commitForm").serializeArray(),
			            success: function(result) {
			            	 if(result.success==true){
			            	 	 alert("恭喜您，代理商报单成功。");
			            		 window.location.href="<%=basePath%>/member/member/memberYesActiveList.shtml";

												} else {
													alert("报单失败。" + result.msg);
													location.reload();//刷新页面   
												}

												//放到回调里
												this_
														.removeAttribute("disabled");
												this_.value = "提  交";
											}
										});
							}
						});
	});
</script>
</head>


<body>
	<script src="<%=basePath%>/resources/memberCss2/assets/js/theme.js"></script>
	<div class="page-heading">
		<h3>账号管理</h3>
		<ul class="breadcrumb">
			<li>账号管理</li>
			<li class="active">空单报单代理商</li>
		</ul>
	</div>
	<section class="wrapper">
		<div class="row">
			<div class="col-lg-12">
				<section class="panel">
					<header class="panel-heading"> 空单报单代理商 </header>
					<div class="panel-body">
						<form name="commitForm" id="commitForm" class="form-horizontal adminex-form" method="post">
							<input type="hidden" id="loginName" name="loginName" value="${member.loginName}" /> 
							<input type="hidden" name="token" value="${token}" />
							<jodd:form scopes="request" beans="member">
								<div class="form-group">
									<label class="col-sm-2 col-sm-2 control-label">代理商账号：</label>
									<div class="col-sm-10">${member.loginName}</div>
								</div>


								<div class="form-group">
									<label class="col-sm-2 col-sm-2 control-label">姓名：</label>
									<div class="col-sm-10">${member.personName}</div>
								</div>

								<div class="form-group">
									<label class="col-sm-2 col-sm-2 control-label">联系电话：</label>
									<div class="col-sm-10">${member.tel}</div>
								</div>

								<div class="form-group">
									<label class="col-sm-2 col-sm-2 control-label">推荐人账号：</label>
									<div class="col-sm-10">${member.recommendLoginName}</div>
								</div>

								<div class="form-group">
									<label class="col-sm-2 col-sm-2 control-label">我的购物积分：</label>
									<div class="col-sm-10">${active.ele}</div>
								</div>

								<div class="form-group">
									<label class="col-sm-2 col-sm-2 control-label">确认代理商账号：</label>
									<div class="col-sm-10">
										<input type="text" id="activeLoginName" name="activeLoginName" class="form-control m-bot15" />
									</div>
								</div>

								<div class="form-group">
									<label class="col-sm-2 col-sm-2 control-label">安全密码：</label>
									<div class="col-sm-10">
										<input type="password" class="form-control m-bot15" id="myTwoPassword" name="myTwoPassword" class="tpl-form-input" />
									</div>
								</div>

								<div class="form-group">${retMsg}</div>

								<div class="form-group text-center">
									<button type="button" id="submit" name="submit" class="btn btn-primary">提交</button>
								</div>

							</jodd:form>
						</form>
					</div>
				</section>
			</div>
		</div>
	</section>
	<script src="<%=basePath%>/resources/memberCss2/assets/js/amazeui2.min.js"></script>
	<script src="<%=basePath%>/resources/memberCss2/assets/js/amazeui.datatables.min.js"></script>
	<script src="<%=basePath%>/resources/memberCss2/assets/js/dataTables.responsive.min.js"></script>
	<script src="<%=basePath%>/resources/memberCss2/assets/js/app.js"></script>
</body>


</html>